import request from '@/utils/request'

export default {
  // 获取类别列表
  getCategoryList() {
    // return request.post('/api/category-sort/list').then(res => {
    //   console.log(res)
    // })
    return new Promise((resolve) => {
      request.post('/api/category-sort/list').then(res => {
        resolve(res.data)
      })
    })
  },
  // 更新类别
  updateCategory(data) {
    return new Promise((resolve) => {
      request.post('/api/category-sort/update-sort', data).then(res => {
        resolve(res.data)
      })
    })
  },
  // 删除类别
  deleteCategory(id) {
    return request.post(`/api/category/delete/${id}`)
  },
  // 更新类别排序
  updateCategorySort(data) {
    return request.post('/api/category/updateSort', data)
  }
}